#include<stdio.h>
#define ROWS 3
#define COLS 5

// 计算所有班级的平均分和每个班级的平均分
int main(){
    int score[ROWS][COLS];

    printf("输入15个学生的成绩...\n");
    for (int i = 0; i < ROWS; i++){
        for(int j = 0; j < COLS; j++){
            scanf("%d", &score[i][j]);
        }
    }

    // 初始化为0防止垃圾值
    int sum_total = 0;
    int sum_per_class[ROWS] = {0};
    for(int i = 0; i < ROWS; i++){
        for(int j = 0; j < COLS; j++){
            sum_per_class[i] += score[i][j];
            sum_total += score[i][j];
        }
    }

    printf("所有班级的平均分:%lf\n", (double)sum_total / (ROWS * COLS));
    for(int i = 0; i < ROWS; i++){
        printf("%d班的平均分:%lf\n", i+1, (double)sum_per_class[i] / COLS);
    }

    return 0;
    
}